<?php
/**
 * @filename QuackCounter.php
 * @author LD King
 * @encoding UTF-8
 * @date 2008-9-19 | 下午04:02:11
 * @package 12-MVC
 * @subpackage 
 * @usage 呱呱叫 计数器
 * @note  装饰者方法
 * @copyright Copyright (c) 2007 - 2008 LD (http://mifunny.info)
 * @version $Id: $
 */

class QuackCounter implements Quackable {
	
	/**
	 * 鸭子对象
	 *
	 * @var Quackable
	 */
	public $duck;
	
	/**
	 * 计数器
	 *
	 * @var int
	 */
	public static $numberOgQuack;
	
	public function __construct(Quackable $duck) {
		$this->duck = $duck;
	}
	
	/**
	 * @see Quackable::quack()
	 *
	 */
	public function quack() {
		echo "QuackCounter  ──  ";
		$this->duck->quack();
		self::$numberOgQuack++;
	}

	/**
	 * 返回鸭子的叫数
	 *
	 * @return int
	 */
	public static function getQuacks() {
		return self::$numberOgQuack;
	}
} /* END class QuackCounter */

?>